package smartgrid.output;

public abstract class AbstractEntity {
	
	public enum EntityType {
		CONTRACT,
		PROVIDER,
		REGULATOR,
		DS_PROSUMER,
		SOCIAL_PROSUMER;
	}
	
	protected enum DataType {
		BOOLEAN,
		DOUBLE,
		INTEGER,
		STRING;
	}
	
	private int			entityId;
	
	private boolean	active;
	
	
	/**
	 * Constructor
	 * 
	 * @param entityId
	 *          Entity identification
	 * @return none
	 */
	public AbstractEntity(int entityId) {
		this.entityId = entityId;
		this.active = false;
	}
	
	
	/**
	 * Get entity identification
	 * 
	 * @param none
	 * @return Entity identification
	 */
	public int getEntityId() {
		return this.entityId;
	}
	
	
	/**
	 * Indicate whether the entity is active or not
	 * 
	 * @param none
	 * @return True - Entity active / False - otherwise
	 */
	public boolean isActive() {
		return this.active;
	}
	
	
	/**
	 * Set the entity active
	 * 
	 * @param none
	 * @return none
	 */
	public void setActive() {
		this.active = true;
	}
	
	
	/**
	 * Set the value of the entity field
	 * 
	 * @param fieldStr
	 *          Entity field name
	 * @param value
	 *          Entity field value
	 * @return none
	 */
	public abstract void setValue(String fieldStr, Object value);
	
	
	/**
	 * Get the value of the entity field
	 * 
	 * @param fieldStr
	 *          Entity field name
	 * @return Entity field value
	 */
	public abstract Object getValue(String fieldStr);
	
	
	/**
	 * Get the entity fields as a text line
	 * 
	 * @param none
	 * @return Entity fields as text
	 */
	public abstract String getLine();
	
	
	/**
	 * Get the entity type's file header
	 * 
	 * @param none
	 * @return Entity type's file header
	 */
	public abstract String getHeader();
}